package com.uwlaser.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.*;
import com.uwlaser.base.CommonModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
* @author mx
* @date 2023-01-04
*/
@Data
@Builder
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = false)
@TableName("factory_shift_history")
public class FactoryShiftHistory extends CommonModel<FactoryShiftHistory> implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "ID")
    @TableId(type= IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "所属模型")
    private String templateCode;

    @ApiModelProperty(value = "创建时间")
    @TableField(fill= FieldFill.INSERT)
    private Date createTime;

    @ApiModelProperty(value = "日期")
    private String dateTime;

    @ApiModelProperty(value = "数据json")
    private String dataJson;

    public void copyFrom(FactoryShiftHistory source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
